home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10980 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  57 lines

  1. Path: news.cityu.edu.hk!00842506
  2. From: 00842506@cpccux0.cityu.edu.hk (Maxeller)
  3. Newsgroups: comp.lang.c
  4. Subject: Help ! Please help me solve the problem
  5. Date: 21 Mar 1996 05:44:02 GMT
  6. Organization: City University of Hong Kong
  7. Message-ID: <4iqqb2$bkf@ctylnk.cityu.edu.hk>
  8. NNTP-Posting-Host: ccspc21.cityu.edu.hk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.   I want to write a disk cache program and so must place my new interrupt
  12.   point into interrupt vector 13 which points to my new function. 
  13.  
  14.   Please take a look at my simple test program please:
  15.  
  16.   unsign long old_int_pointer;
  17.  
  18.   new_int_function()
  19.      {
  20.      
  21.        
  22.       /* just jump to old_int_pointer  which read from disk 
  23.          because it is a test program so nothing others is done */
  24.  
  25.      }
  26.  
  27.   main()
  28.      {
  29.       /* save old int13 pointer into old_int_pointer
  30.          using int21h ax=3513 */
  31.       
  32.       /* put address of new_int_function() into vector 13 area
  33.          using int21h ax=2513 */
  34.  
  35.       /* TSR function goes here */
  36.  
  37.      }
  38.  
  39.  Save and put new interrupt address and TSR is OK.
  40.  
  41.  However when disk reading is involved, it hangs.
  42.  
  43.  My problem is : 
  44.       1) what code should write so it can jump to my 
  45.          old_int_pointer. I have though for a long time!! :-(
  46.       2) I am afraid that when control is passed to new_int_function,
  47.          it can not retrieve values such as old_int_pointer because
  48.          the segment register may not match as that in my program.
  49.  
  50.  Please send me a mail if you have any idea.
  51.  Thanks a lot !! :-)
  52.  
  53.  N.Cheung
  54.  00842506@cpccux0.cityu.edu.hk
  55.  
  56.  
  57.